import {request} from "../request";
import {utils} from "../../common/utils";

//1.获取流程类型
export function getProClassify(){
    return request({
        url: '/sys/process-classify/query',
        method: 'get'
    })
}

//2.添加流程类型
export function addProClassify({name}) {
    return request({
        url: '/sys/process-classify/add',
        method: 'post',
        data:{name}
    })
}

//3.修改流程类型
export function updateProClassify({id,name}) {
    return request({
        url: '/sys/process-classify/update',
        method: 'put',
        data:{
            id,
            name
        }
    })
}

//4.删除流程类型
export function deleteProClassify(ids){
    let strUrl = utils.joinArrayReqParam(ids,'ids');
    return request({
        url: '/sys/process-classify/delete' + strUrl,
        method: 'delete'
    })
}

//5.获取流程类型选项
export function getProTypeOptions(){
    return request({
        url: '/sys/process-classify/options',
        method: 'get'
    })
}

//6.是否存在相同名称的流程类型
export function hasSomeNameProClassify({id,name}){
    return request({
        url: '/sys/process-classify/has-some-name',
        method: 'get',
        params:{
            id,
            name
        }
    })
}